<?php foreach ($list as $val){
if ($val['user']['id'] == $this->account['aid'] && $act =='comments_to_me')
{
	continue;
}
?>
<div class="comment_list comment_<?php echo $val['id'];?>">
	<?php if ($act =='comments_to_me') {?>
	<img src="<?php echo $val['user']['profile_image_url'];?>" class="img"/>
	<?php }else{?>
	<img src="<?php echo $val['status']['user']['profile_image_url'];?>" class="img"/>
	<?php }?>
	<ul>
		<li class="body"><?php echo $val['text'];?> (22小时前)</li>
		<?php if (!empty($val['reply_comment']['text'])){?>
		<li  style="height:25px;overflow:hidden;">回复我的评论：<a href="#"><?php echo $val['reply_comment']['text'];?></a></li>
		<?php }else{?>
		<li style="height:25px;overflow:hidden;">评论<a href="#"><?php echo $val['status']['user']['name'];?></a>的微博：<a href="#"><?php echo $val['status']['text'];?></a></li>
		<?php }?>
		<li style="text-align:right;"> 
		<?php if ($act =='comments_to_me') {?>
		<a href="javascript:" onclick="reply(<?php echo $val['id'];?>)">回复</a> |　
		<?php }?>
		<a href="javascript:" onclick="comment_del(<?php echo $val['id'];?>)">删除</a>
		</li>
		<li class="zhuanfa_li reply_<?php echo $val['id'];?>">
			<form id="form1" name="form1" method="post" action="/weibo/reply" class="form1">
				<div class="weibo_zhuanfa ">
					<p>回复此条评论 </p>
					<textarea name="comment" class="zhuanfa_body"> 回复@<?php echo $val['user']['screen_name'];?>：</textarea>
					<div class="zhuanfa_ps overflow">
						<span style="float:left;"><input type="checkbox" name="is_comment" value="1" /> 同时转发</span>
						<input type="submit" value="评论"  class="button_blue yuan " tabindex="2">
						<input type="hidden" name="api" value="<?php echo $api;?>" />
						<input type="hidden" name="id" value="<?php echo $val['status']['id'];?>" />
						<input type="hidden" name="cid" value="<?php echo $val['id'];?>" />
					</div>
				</div>
			</form>
		</li>
	</ul>
</div>
<?php }?>
<script>
function comment_del(ids)
{
	$.post('/weibo/comment_del/',{id:ids},function(data){
		//alert(data);
		if (data == '1')
		{
			$(".comment_"+ids).hide(300);
		}
		else
		{
			alert('删除失败.');
		}
	})
	return false;
}

function reply(id)
{
	
	if ($(".reply_"+id).css('display') == 'none')
	{
		$(".reply_"+id).show(300,function(){
			$(".reply_"+id).find('textarea').focus()
		});
		
	}
	else
	$(".reply_"+id).hide(300);
}

/* 提交回复 */
$(function(){
	$(".form1").submit(function(){
		button = $(this).find('.button_blue');
		$(button).val('正在评论...').attr('disabled',true);
		id = $(this).find('input[name=cid]').val();

		$.post($(this).attr('action'),$(this).serialize(),function(data){
			tb_show('回复评论','#TB_inline?height=100&width=200&inlineId=box_ps');
			tb_ps('回复成功！');
			$(".reply_"+id).hide(300);
			$(button).val('评论').attr('disabled',false);
			setTimeout('tb_remove()',1000);
		})
		return false;
	})
})
</script>